@main("Prova Móvel - Test Ajax") { @header()

<div class="container">

	<h1>Ajax</h1>
	<div>

		<button id="ajaxbtn">Ajax</button>
	</div>


</div>
<!-- /container -->

<script>
	$(function() {
		alert("vai filho");

		$('#ajaxbtn').click(function() {
			var test = {
				a : [3,5],
				b : 2
			};
			var param = {
				"name" : test
			};
			alert("vai filho2");

			alert("@routes.Application.ajax");
			var values = {
				//data : '{"name":[1,2], "remark":"hello"}',
				data : JSON.stringify(param),
				dataType : "json",
				contentType : "application/json",
				type : "POST",
				url : "@routes.Application.ajax",
				success : function(v) {
					alert(JSON.stringify(v));
				},
				error : function() {
					alert("error");
				}
			};
			$.ajax(values);
		});

	});
</script>

}
